public class demo4 {
    public static void main(String[] args) {
        int[] arry = {1,2,3,4,5};
        for (int i = 0,j =arry.length-1; i < j; i++,j--) {
            int tmp = arry[i];
            arry[i] = arry[j];
            arry[j] = tmp;
        }

        for (int i = 0; i < arry.length; i++) {
            System.out.print(arry[i]+ " ");
        }
    }
}
